home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / langs / iconv8_l.arc / PROGS.ARC / diffword.icn < prev    next >
Encoding:
Text File  |  1990-03-08  |  705 b   |  28 lines

  1. ############################################################################
  2. #
  3. #    Name:    diffword.icn
  4. #
  5. #    Title:    List different words
  6. #
  7. #    Author:    Ralph E. Griswold
  8. #
  9. #    Date:    May 9, 1989
  10. #
  11. ############################################################################
  12. #
  13. #  This program lists all the different words in the input text.
  14. #  The definition of a "word" is naive.
  15. #
  16. ############################################################################
  17.  
  18. procedure main()
  19.    local letter, words, text
  20.  
  21.    letter := &letters
  22.    words := set()
  23.    while text := read() do
  24.       text ? while tab(upto(letter)) do
  25.          insert(words,tab(many(letter)))
  26.    every write(!sort(words))
  27. end
  28.